<!DOCTYPE html>
<html lang="zh-hans">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">

    <title>小毛驴车管家</title>


    <!-- Bootstrap core CSS -->

    <link href="__STATIC__/css/bootstrap.min.css" rel="stylesheet">

    <link href="__STATIC__/fonts/css/font-awesome.min.css" rel="stylesheet">
    <link href="__STATIC__/css/animate.min.css" rel="stylesheet">

    <!-- Custom styling plus plugins -->
    <link href="__STATIC__/css/custom.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/maps/jquery-jvectormap-2.0.3.css" />
    <link href="__STATIC__/css/icheck/flat/green.css" rel="stylesheet" />
    <link href="__STATIC__/css/floatexamples.css" rel="stylesheet" type="text/css" />

    <script src="__STATIC__/js/jquery.min.js"></script>
    <script src="__STATIC__/js/nprogress.js"></script>


    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->

</head>
<!--

-->
<!--总台-->
{if condition="session('auding_status') eq 2 && (session('role_id') == 1 || session('role_id') == 2)"}
<script>
    var func = function (){
        $.ajax({
            type:'POST',
            url:'{:url("order/news")}',
            dataType:'json',
            success:function(data){
                //console.log(JSON.stringify(data));
                //data = JSON.stringify(data);

                if(data.code == 200)
                {

                    playSound();
                    console.log(data.message);
                }
                else{
                    console.log('else');
                    //console.log('else'+data.message);
                }
            }
        });
        $.ajax({
            type:'POST',
            url:'{:url("order/goods_count")}',
            dataType:'json',
            success:function(data){
                //console.log(JSON.stringify(data));
                //data = JSON.stringify(data);

                if(data.code == 200)
                {

                    $('#goods').text(data.count);
                }

            }
        });
        $.ajax({
            type:'POST',
            url:'{:url("order/service_count")}',
            dataType:'json',
            success:function(data){
                //console.log(JSON.stringify(data));
                //data = JSON.stringify(data);

                if(data.code == 200)
                {

                    $('#service').text(data.count);
                }

            }
        });
        $.ajax({
            type:'POST',
            url:'{:url("order/gift_count")}',
            dataType:'json',
            success:function(data){
                console.log(data);
                //console.log(JSON.stringify(data));
                //data = JSON.stringify(data);
                if(data.code == 200)
                {

                    $('#gift').text(data.count);
                }

            }
        });

    }

    var playSound = function () {
        var borswer = window.navigator.userAgent.toLowerCase();
        if( borswer.indexOf( "ie" ) >= 0 )
        {
            //IE内核浏览器
            var strEmbed = '<embed name="embedPlay" src="/41.mp3" autostart="true" hidden="true" loop="false"></embed>';
            if ( $( "body" ).find( "embed" ).length <= 0 )
                $( "body" ).append( strEmbed );
            var embed = document.embedPlay;

            //浏览器不支持 audion，则使用 embed 播放
            embed.volume = 100;
            //embed.play();这个不需要
        } else
        {
            //非IE内核浏览器
            var strAudio = "<audio id='audioPlay' src='/41.mp3' hidden='true'>";

            if($("#audioPlay").length<=0){
                $( "body" ).append( strAudio );
            }

            var audio = document.getElementById( "audioPlay" );
            console.log('play');
            //浏览器支持 audio
            audio.play();
        }
    }
    //主动调用
    setInterval("func()", 3000);

</script>
{/if}
<!--总台-->

<!--门店 news_shop goods_count_shop service_count_shop
news_shop 商家订单声音提醒 包含 1 2 类状态 is_read_shop 仅仅负责提示音
-->
{eq name=":session('auding_status')" value="1"}
<script>
    var func = function (){
        $.ajax({
            type:'POST',
            url:'{:url("order/news_shop")}',
            dataType:'json',
            success:function(data){
                //console.log(JSON.stringify(data));
                //data = JSON.stringify(data);
                console.log('门店订单提醒消息提醒news_shop'+data);
                if(data.code == 200)
                {
                    console.log('门店订单提醒消息提醒news_shop200');
                    playSound();
                    console.log(data.message);
                }
                else{
                    console.log('门店订单提醒消息提醒news_shopelse');
                    //console.log('else'+data.message);
                }
            }
        });
        //礼包订单消息提醒
        $.ajax({
            type:'POST',
            url:'{:url("order/news_gift")}',
            dataType:'json',
            success:function(data){
                //console.log(JSON.stringify(data));
                //data = JSON.stringify(data);
                console.log('门店礼包订单提醒消息提醒news_gift'+data);
                if(data == true)
                {
                    console.log('礼包礼包');
                    playSound();
                   // console.log(data.message);
                }
                else{
                    //console.log('else'+data.message);
                }
            }
        });
        $.ajax({
            type:'POST',
            url:'{:url("order/goods_count_shop")}',
            dataType:'json',
            success:function(data){
                //console.log(JSON.stringify(data));
                //data = JSON.stringify(data);

                if(data.code == 200)
                {
                    console.log('商品正常未读数量');
                    $('#goods').text('下单:'+data.count);
                }

            }
        });
        $.ajax({
            type:'POST',
            url:'{:url("order/service_count_shop")}',
            dataType:'json',
            success:function(data){
                //console.log(JSON.stringify(data));
                //data = JSON.stringify(data);

                if(data.code == 200)
                {
                    console.log('is_read_shop0门店未读订单order/service_count_shop'+data.count);
                    $('#service').text('下单:'+(data.count));
                }

            }
        });
        $.ajax({
            type:'POST',
            url:'{:url("order/news_gift_count")}',
            dataType:'json',
            success:function(data){
                //console.log(JSON.stringify(data));
                //data = JSON.stringify(data);

                    $('#gift').text(data);


            }
        });

    }

    var playSound = function () {
        var borswer = window.navigator.userAgent.toLowerCase();
        if( borswer.indexOf( "ie" ) >= 0 )
        {
            //IE内核浏览器
            var strEmbed = '<embed name="embedPlay" src="/41.mp3" autostart="true" hidden="true" loop="false"></embed>';
            if ( $( "body" ).find( "embed" ).length <= 0 )
                $( "body" ).append( strEmbed );
            var embed = document.embedPlay;

            //浏览器不支持 audion，则使用 embed 播放
            embed.volume = 100;
            //embed.play();这个不需要
        } else
        {
            //非IE内核浏览器
            var strAudio = "<audio id='audioPlay' src='/41.mp3' hidden='true'>";

            if($("#audioPlay").length<=0){
                $( "body" ).append( strAudio );
            }

            var audio = document.getElementById( "audioPlay" );
            console.log('play');
            //浏览器支持 audio
            audio.play();
        }
    }

    //主动调用
    setInterval("func()", 3000);

</script>
{/eq}
<!--门店退款-->
<!--门店退款或者审核角色-->
{if condition="(session('auding_status') eq 1 && strpos('5',(string)session('role_id')) !== false) || (session('auding_status') eq 2 && strpos('7,8,9,10',(string)session('role_id')) !== false)"}
<script>
    var funcss = function (){
        //console.log('门店退款或者审核角色');
        $.ajax({
            type:'POST',
            url:'{:url("order/refund_news")}',
            dataType:'json',
            success:function(data){
                //console.log(JSON.stringify(data));
                //data = JSON.stringify(data);
                if(data.code == 200)
                {
                    console.log('商品和服务门店退款或者审核角色'+data.message);
                    playSounds();


                }
                else{
                    console.log('else');
                    //console.log('else'+data.message);
                }
            }
        });
        $.ajax({
            type: 'POST',
            url: '{:url("order/refund_goods_count")}',
            dataType: 'json',
            success: function (data) {
                //console.log(JSON.stringify(data));
                //data = JSON.stringify(data);
                console.log('order/refund_goods_count=order_type1数量'+data.count);
                if (data.code == 200) {
                    $('#goods').text('退款:'+data.count);
                }

            }
        });
        $.ajax({
            type: 'POST',
            url: '{:url("order/refund_service_count")}',
            dataType: 'json',
            success: function (data) {
                //console.log(JSON.stringify(data));
                //data = JSON.stringify(data);
                console.log('order/refund_service_count=order_type2数量'+data.count);
                if (data.code == 200) {

                    $('#service').text('退款:'+data.count);
                }

            }
        });
//        $.ajax({
//            type: 'POST',
//            url: '{:url("order/refund_gift_count")}',
//            dataType: 'json',
//            success: function (data) {
//                //console.log(JSON.stringify(data));
//                //data = JSON.stringify(data);
//                if (data.code == 200) {
//
//                    $('#gift').text(data.count);
//                }
//
//            }
//        });

    }

    var playSounds = function () {
        var borswer = window.navigator.userAgent.toLowerCase();
        if( borswer.indexOf( "ie" ) >= 0 )
        {
            //IE内核浏览器
            var strEmbed = '<embed name="embedPlay" src="/8855.wav" autostart="true" hidden="true" loop="false"></embed>';
            if ( $( "body" ).find( "embed" ).length <= 0 )
                $( "body" ).append( strEmbed );
            var embed = document.embedPlay;

            //浏览器不支持 audion，则使用 embed 播放
            embed.volume = 100;
            //embed.play();这个不需要
        } else
        {
            //非IE内核浏览器
            var strAudio = "<audio id='audioPlay' src='/8855.wav' hidden='true'>";

            if($("#audioPlay").length<=0){
                $( "body" ).append( strAudio );
            }

            var audio = document.getElementById( "audioPlay" );
            console.log('门店退款或者审核角色');
            //浏览器支持 audio
            audio.play();
        }
    }
    //主动调用
    setInterval("funcss()", 10000);



</script>
{/if}
<!--
礼包退款
//礼包退款取消 门店判断
-->
{if condition="(session('auding_status') eq 2 && strpos('7,8,9,10',(string)session('role_id')) !== false)"}
<script>
    var funcs = function (){
        $.ajax({
            type:'POST',
            url:'{:url("order/refund_gift_news")}',
            dataType:'json',
            success:function(data){
                //console.log(JSON.stringify(data));
                //data = JSON.stringify(data);
                if(data.code == 200)
                {
                    playSounds();
                    console.log(data.message);
                }
                else{
                    console.log('else');
                    //console.log('else'+data.message);
                }
            }
        });

        $.ajax({
            type: 'POST',
            url: '{:url("order/refund_gift_count")}',
            dataType: 'json',
            success: function (data) {
                //console.log(JSON.stringify(data));
                //data = JSON.stringify(data);
                if (data.code == 200) {
                    console.log('礼包退款数order/refund_gift_count-is_read_'+data.level+'总数'+data.count);
                    $('#gift').text('退款:'+data.count);
                }

            }
        });

    }

    var playSounds = function () {
        var borswer = window.navigator.userAgent.toLowerCase();
        if( borswer.indexOf( "ie" ) >= 0 )
        {
            //IE内核浏览器
            var strEmbed = '<embed name="embedPlay" src="/8855.wav" autostart="true" hidden="true" loop="false"></embed>';
            if ( $( "body" ).find( "embed" ).length <= 0 )
                $( "body" ).append( strEmbed );
            var embed = document.embedPlay;

            //浏览器不支持 audion，则使用 embed 播放
            embed.volume = 100;
            //embed.play();这个不需要
        } else
        {
            //非IE内核浏览器
            var strAudio = "<audio id='audioPlay' src='/8855.wav' hidden='true'>";

            if($("#audioPlay").length<=0){
                $( "body" ).append( strAudio );
            }

            var audio = document.getElementById( "audioPlay" );
            console.log('play');
            //浏览器支持 audio
            audio.play();
        }
    }
    //主动调用
    setInterval("funcs()", 10000);



</script>
{/if}
